package br.com.sgi.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import br.com.sgi.dao.UsersDao;
import br.com.sgi.model.Users;
import br.com.sgi.service.UsersService;

@Service("usersService")
public class UsersServiceImpl implements UsersService {

	@Autowired
	UsersDao usersDao;
	
	@Override
	public List<Users> buscarUsersPorCoSistema(Long coSistema) {
		 Map<String, Object>  params = new java.util.HashMap<String, Object>();
		 params.put("coSistema", coSistema);
		return usersDao.findByNamedParams("buscarUsersPorCoSistema", params);
	}

	@Override
	public void salvar(Users users) {
		usersDao.save(users);
		
	}

	@Override
	public List<Users> buscarUsersPorUsername(String username) {
		 Map<String, Object>  params = new java.util.HashMap<String, Object>();
		 params.put("username", username);
		 usersDao.findByNamedParams("findByUsername", params);
		return null;
	}

}
